/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import java.io.Serializable;

import com.chlitina.store.modules.sys.entity.Area;

/**
 * 复合主键
 * @author liujiang
 * @version 2013-06-07
 */
public class DiagnoseAreaPK implements Serializable{
	
	private static final long serialVersionUID = 1L;
	private Area area; // 区域
	private StoreDiagnoseTemplate storeDiagnoseTemplate; // 店面诊断模板
	
	public DiagnoseAreaPK() {
		
	}
	
	public DiagnoseAreaPK(Area area, StoreDiagnoseTemplate storeDiagnoseTemplate) {
		this.area = area;
		this.storeDiagnoseTemplate = storeDiagnoseTemplate;
	}
	
	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public StoreDiagnoseTemplate getStoreDiagnoseTemplate() {
		return storeDiagnoseTemplate;
	}

	public void setStoreDiagnoseTemplate(StoreDiagnoseTemplate storeDiagnoseTemplate) {
		this.storeDiagnoseTemplate = storeDiagnoseTemplate;
	}
	
	@Override
	public int hashCode() {
		return this.area.hashCode() + this.storeDiagnoseTemplate.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final DiagnoseAreaPK other = (DiagnoseAreaPK) obj;
		if (area.getId() == other.getArea().getId() &&
				storeDiagnoseTemplate.getId() == other.getStoreDiagnoseTemplate().getId()) {
			return true;
		} 
		return false;
	}
}